<?php
namespace app\common\model;
use think\Model;
use fast\Cols;
class Student extends Model
{
	protected $pk = 'itemid';
	// 开启自动写入时间戳字段
	protected $autoWriteTimestamp = 'int';
	// 定义时间戳字段名
	protected $createTime = 'createtime';
	protected $updateTime = 'updatetime';
	public static function init(){
		self::event('after_insert', function($row){
		});
		self::event('after_update', function($row){
		});
		self::event('after_delete', function($row){
		});
	}
	public function getUpdatetimeValue($value){
		return Date::timetodate($value,3);
	}
	public function getCreatetimeValue($value){
		return Date::timetodate($value,3);
	}
	public function city(){
		return $this->belongsTo('City','cityid','itemid');
	}
	public function classes(){
		return $this->belongsTo('Classes','classesid','itemid');
	}
	public function province(){
		return $this->belongsTo('Province','provinceid','itemid');
	}
	}
?>
